package com.gitee.hermer.engine.jars.core.web.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import com.gitee.hermer.boot.jee.commons.utils.StringUtils;
import com.gitee.hermer.engine.jars.core.domain.EngineConstant;
import com.gitee.hermer.engine.jars.dependent.dsm.domain.EngineProperties;

@PropertySource(EngineConstant.ENGINE_CONFIG_PROPERTIES_CLASS_PATH)
@Component
public class ResourceProperties extends EngineProperties{

	@Value(EngineConstant.PROPERTIES_KEY_ENGINE_CONFIG_WEB_RESOURCE_LOCATIONS)
	private String locations;
	@Value(EngineConstant.PROPERTIES_KEY_ENGINE_CONFIG_WEB_RESOURCE_CACHE_ENABLE)
	private Boolean enable;
	@Value(EngineConstant.PROPERTIES_KEY_ENGINE_CONFIG_WEB_RESOURCE_CACHE_EXPIRE)
	private Integer expire;
	
	
	public String[] getLocationsArray(){
		return StringUtils.split(locations, EngineConstant.STR_COMMA);
	}

	public String getLocations() {
		return locations;
	}

	public void setLocations(String locations) {
		this.locations = locations;
	}
	

	public Boolean getEnable() {
		return enable;
	}

	public void setEnable(Boolean enable) {
		this.enable = enable;
	}

	public Integer getExpire() {
		return expire;
	}

	public void setExpire(Integer expire) {
		this.expire = expire;
	}
	
	
	
}
